package com.lifa.service.impl;

import com.lifa.dao.JicunDao;
import com.lifa.entity.Chanpin;
import com.lifa.entity.Huiyuan;
import com.lifa.entity.Jicun;
import com.lifa.entity.SPquchushijian;
import com.lifa.service.JicunService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JicunServiceImpl implements JicunService {
    @Autowired
    private JicunDao jicunDao;
    @Autowired
    private JicunService jicunService;

    public List<Jicun> list() {
        return jicunDao.query();
    }
    @Override
    public List<Jicun> findAll(String name, int offset, int limit) {
        return jicunDao.queryPage(name,offset,limit);
    }

    @Override
    public int findTotalCount(String name) {
        return jicunDao.getTotalCount(name);
    }



    /**
     * 获取到会员id
     * @param huiyuan_Id
     * @return
     */
    @Override
    public Jicun queryId(int huiyuan_Id){
        return jicunDao.queryId(huiyuan_Id);
    }

    /**
     * 根据会员id修改信息
     * @param jicun
     * @return
     */
    @Override
    public int update(Jicun jicun) {
        return jicunDao.update(jicun);
    }

    /**
     * 添加商品取出记录
     * @param
     * @return
     */
    @Override
    public int insert(SPquchushijian sPquchushijian) {
        return jicunDao.insert(sPquchushijian);
    }

    /**
     * 查询会员信息
     * @return
     */
    @Override
    public List<Huiyuan> cha(int huiyuan_Id) {
        return jicunDao.cha(huiyuan_Id);
    }

    /**
     * 查询商品信息
     * @return
     */
    @Override
    public List<Chanpin> chax() {
        return jicunDao.chax();
    }

    /**
     * 添加寄存信息
     * @param jicun
     * @return
     */
    @Override
    public int add(Jicun jicun) {
        return jicunDao.add(jicun);
    }
}
